package leetcode.linkedlist;

import leetcode.linkedlist.common.LinkedListUtils;
import leetcode.linkedlist.common.ListNode;

/**
 * Definition for singly-linked list.
 * public class ListNode {
 * int val;
 * ListNode next;
 * ListNode() {}
 * ListNode(int val) { this.val = val; }
 * ListNode(int val, ListNode next) { this.val = val; this.next = next; }
 * }
 */
class Solution1669 {
    public ListNode mergeInBetween(ListNode list1, int a, int b, ListNode list2) {
        return LinkedListUtils.mergeInBetween(list1, a, b, list2);

    }
}

public class leetcode1669 {
    public static void main(String[] args) {
        Solution1669 solution1669 = new Solution1669();
        int[] list1 = {0, 1, 2, 3, 4, 5};
        int[] list2 = {1000000, 1000001, 1000002};
        test1669(solution1669, list1, list2, 3, 4);
    }

    private static void test1669(Solution1669 solution1669, int[] list1, int[] list2, int left, int right) {
        ListNode head1 = LinkedListUtils.generateLinkedListByArray(list1);
        ListNode head2 = LinkedListUtils.generateLinkedListByArray(list2);
        System.out.println(solution1669.mergeInBetween(head1, left, right, head2));
    }
}
